Skip to main content

mockseries.signal.signal

Signal#

class Signal()

Interface representing any type of signal.

generate#

| generate(time_points: Union[List[datetime], np.ndarray]) -> np.ndarray

Generate a signal from a list of times.

preview_year#

| preview_year(num_years: int = 1, start_time: Optional[datetime] = None) -> None

Plot one year of signal with a day granularity.

Arguments:

  • num_years - Number of years to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

preview_month#

| preview_month(num_months: int = 1, start_time: Optional[datetime] = None) -> None

Plot one month of signal with an hour granularity.

Arguments:

  • num_months - Number of months to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

preview_week#

| preview_week(num_weeks: int = 1, start_time: Optional[datetime] = None) -> None

Plot one week of signal with an hour granularity.

Arguments:

  • num_weeks - Number of weeks to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

preview_day#

| preview_day(num_days: int = 1, start_time: Optional[datetime] = None) -> None

Plot one day of signal with a minute granularity.

Arguments:

  • num_days - Number of days to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

preview_hour#

| preview_hour(num_hours: int = 1, start_time: Optional[datetime] = None) -> None

Plot one hour of signal with a second granularity.

Arguments:

  • num_hours - Number of hours to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

preview_minute#

| preview_minute(num_minutes: int = 1, start_time: Optional[datetime] = None) -> None

Plot one minute of signal with a centisecond granularity.

Arguments:

  • num_minutes - Number of hours to plot.
  • start_time - Time from which to start. If None, defaults to current datetime.

__add__#

| __add__(other: Union["Signal", int, float]) -> "Signal"

Add two signals.

__mul__#

| __mul__(other: Union["Signal", int, float]) -> "Signal"

Multiply two signals.

__sub__#

| __sub__(other: Union["Signal", int, float]) -> "Signal"

Subtract one signal from another.

__neg__#

| __neg__() -> "Signal"

Get the opposite of a signal.

__rmul__#

| __rmul__(other: Union[float, int]) -> "Signal"

Multiplies by a constant.

__radd__#

| __radd__(other: Union[float, int]) -> "Signal"

Adds a flat component.